package com.lagou.filter.component;


public class IpAddressThreadLocal {

  private static ThreadLocal<String> ipAddressThreadLocal = new ThreadLocal<>();

  private static IpAddressThreadLocal INSTANCE = new IpAddressThreadLocal();

  private IpAddressThreadLocal() {}

  public static IpAddressThreadLocal getInstance() {
    return INSTANCE;
  }

  public void setIpAddress(String ip) {
    ipAddressThreadLocal.set(ip);
  }

  public String getIpAddress() {
    return ipAddressThreadLocal.get();
  }

}
